import java.util.Scanner;

public class Test {
    //计算字符串最后一个单词的长度，单词以空格隔开
        public static void main(String[] args) {
            Scanner in = new Scanner(System.in);
            while (in.hasNextLine()) {
                String str = in.nextLine();
                //法一
//                int a = str.lastIndexOf(" ");
//                String s = str.substring(a+1);
//                System.out.println(s.length());
                //法二
                String arr[] = str.split(" ");
                System.out.println(arr[arr.length-1].length());
            }
        }
    }
